package com.lablzh.gdxy.repository;

import com.lablzh.gdxy.entity.Instructor;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import javax.transaction.Transactional;

public interface InstructorRepository extends JpaRepository<Instructor,Integer> {

    Instructor findAllByUsername(String username);
    @Transactional
    @Modifying
    @Query("update Instructor set password=?2 where username=?1")
    void updatePasswordByUsername(String username, String password);
}
